package com.logistics.controller.tenant;

import com.logistics.common.Result;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 租户端 - Dashboard 控制器
 */
@RestController
@RequestMapping("/tenant/dashboard")
public class TenantDashboardController {
    
    /**
     * 获取租户统计数据
     */
    @GetMapping("/stats")
    @PreAuthorize("hasAuthority('y5b8n2t6') or hasAnyRole('SUPER_ADMIN','SITE_ADMIN')")
    public Result<Map<String, Object>> getStats() {
        Map<String, Object> stats = new HashMap<>();
        stats.put("todayOrders", 28);
        stats.put("deliveringOrders", 42);
        stats.put("completedOrders", 35);
        stats.put("todayRevenue", 17500);
        return Result.success(stats);
    }
}

